﻿#include <iostream>

using namespace std;

class GiveGift {
    virtual void GiveDolls() = 0;
    virtual void GiveFlowers() = 0;
    virtual void GiveChocolate() = 0;
};

class SchoolGirl {
public:
    const string &getName() const {
        return name;
    }
    void setName(const string &newName) {
        name = newName;
    }

private:
    string name;
};

class Pursuit : public GiveGift {
private:
    SchoolGirl* m_mm;
public:
    Pursuit(SchoolGirl* mm) : m_mm(mm) {}
    virtual void GiveDolls() override {
        cout << m_mm->getName() + " 送你洋娃娃" << endl;
    }
    virtual void GiveFlowers() override {
        cout << m_mm->getName() + " 送你鲜花" << endl;
    }
    virtual void GiveChocolate() override {
        cout << m_mm->getName() + " 送你巧克力" << endl;
    }
};

class Proxy : public GiveGift {
private:
    Pursuit* gg;
public:
    Proxy(SchoolGirl* mm) {
        gg = new Pursuit(mm);
    }
    virtual void GiveDolls() override {
        gg->GiveDolls();
    }
    virtual void GiveFlowers() override {
        gg->GiveFlowers();
    }
    virtual void GiveChocolate() override {
        gg->GiveFlowers();
    }
};

int main(int argc, char *argv[])
{
    SchoolGirl* jiaojiao = new SchoolGirl();
    jiaojiao->setName("李娇娇");
    Proxy* daili = new Proxy(jiaojiao);

    daili->GiveDolls();
    daili->GiveFlowers();
    daili->GiveChocolate();

    return 0;
}

